Optimal. Leaf size=135 \[ \frac {2 C \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (A+C) \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {2 A \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.162, Rules used = {4172, 4108,
3893, 212, 3886, 221} \begin {gather*} -\frac {\sqrt {2} (A+C) \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x) \sqrt {\sec (c+d x)}}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}+\frac {2 A \sin (c+d x) \sqrt {\sec (c+d x)}}{d \sqrt {a \sec (c+d x)+a}}+\frac {2 C \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 221
Rule 3886
Rule 3893
Rule 4108
Rule 4172
Rubi steps
\begin {align*} \int \frac {A+C \sec ^2(c+d x)}{\sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)}} \, dx &=\frac {2 A \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {2 \int \frac {\sqrt {\sec (c+d x)} \left (-\frac {a A}{2}+\frac {1}{2} a C \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{a}\\ &=\frac {2 A \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+(-A-C) \int \frac {\sqrt {\sec (c+d x)}}{\sqrt {a+a \sec (c+d x)}} \, dx+\frac {C \int \sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)} \, dx}{a}\\ &=\frac {2 A \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}-\frac {(2 C) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a}}} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{a d}+\frac {(2 (A+C)) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,-\frac {a \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 C \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (A+C) \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {2 A \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(504\) vs. \(2(135)=270\).
time = 2.81, size = 504, normalized size = 3.73 \begin {gather*} -\frac {\tan (c+d x) \left (\frac {8 A}{\sqrt {\frac {1}{1+\cos (c+d x)}}}-8 A \sqrt {\sec (c+d x)} \sqrt {1+\sec (c+d x)}+8 C \log (1+\sec (c+d x)) \sqrt {\tan ^2(c+d x)}-8 C \log \left (\sqrt {\sec (c+d x)}+\sec ^{\frac {3}{2}}(c+d x)+\sqrt {1+\sec (c+d x)} \sqrt {\tan ^2(c+d x)}\right ) \sqrt {\tan ^2(c+d x)}+\sqrt {2} A \log \left (1-2 \sec (c+d x)-3 \sec ^2(c+d x)-2 \sqrt {2} \sqrt {\sec (c+d x)} \sqrt {1+\sec (c+d x)} \sqrt {\tan ^2(c+d x)}\right ) \sqrt {\tan ^2(c+d x)}+\sqrt {2} C \log \left (1-2 \sec (c+d x)-3 \sec ^2(c+d x)-2 \sqrt {2} \sqrt {\sec (c+d x)} \sqrt {1+\sec (c+d x)} \sqrt {\tan ^2(c+d x)}\right ) \sqrt {\tan ^2(c+d x)}-\sqrt {2} A \log \left (1-2 \sec (c+d x)-3 \sec ^2(c+d x)+2 \sqrt {2} \sqrt {\sec (c+d x)} \sqrt {1+\sec (c+d x)} \sqrt {\tan ^2(c+d x)}\right ) \sqrt {\tan ^2(c+d x)}-\sqrt {2} C \log \left (1-2 \sec (c+d x)-3 \sec ^2(c+d x)+2 \sqrt {2} \sqrt {\sec (c+d x)} \sqrt {1+\sec (c+d x)} \sqrt {\tan ^2(c+d x)}\right ) \sqrt {\tan ^2(c+d x)}\right )}{4 d (-1+\sec (c+d x)) \sqrt {1+\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(272\) vs.
\(2(114)=228\).
time = 21.22, size = 273, normalized size = 2.02
method | result | size |
default | \(-\frac {\left (-C \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )-\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )+C \sqrt {2}\, \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )-2 A \arctan \left (\frac {\sin \left (d x +c \right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}}{2}\right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )-2 C \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \arctan \left (\frac {\sin \left (d x +c \right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}}{2}\right ) \sin \left (d x +c \right )+4 A \cos \left (d x +c \right )-4 A \right ) \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}}{2 d \sin \left (d x +c \right ) \sqrt {\frac {1}{\cos \left (d x +c \right )}}\, a}\) | \(273\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 580 vs.
\(2 (114) = 228\).
time = 0.66, size = 580, normalized size = 4.30 \begin {gather*} -\frac {\frac {{\left (\sqrt {2} \log \left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - \sqrt {2} \log \left (\cos \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 4 \, \sqrt {2} \sin \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} A}{\sqrt {a}} + \frac {{\left (\sqrt {2} \log \left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 1\right ) - \sqrt {2} \log \left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} - 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 1\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) + \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) - \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right ) + \log \left (2 \, \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right )^{2} - 2 \, \sqrt {2} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) - 2 \, \sqrt {2} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right )\right )\right ) + 2\right )\right )} C}{\sqrt {a}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.67, size = 498, normalized size = 3.69 \begin {gather*} \left [\frac {4 \, A \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + {\left (C \cos \left (d x + c\right ) + C\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - \frac {4 \, {\left (\cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right )\right )} \sqrt {a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}} + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + \frac {\sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \log \left (-\frac {\cos \left (d x + c\right )^{2} + \frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{\sqrt {a}} - 2 \, \cos \left (d x + c\right ) - 3}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right )}{\sqrt {a}}}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, \frac {\sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \sqrt {-\frac {1}{a}} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \sqrt {\cos \left (d x + c\right )}}{\sin \left (d x + c\right )}\right ) + 2 \, A \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + {\left (C \cos \left (d x + c\right ) + C\right )} \sqrt {-a} \arctan \left (\frac {2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{a \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) - 2 \, a}\right )}{a d \cos \left (d x + c\right ) + a d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + C \sec ^{2}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \sqrt {\sec {\left (c + d x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {A+\frac {C}{{\cos \left (c+d\,x\right )}^2}}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}\,\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________